$(document).ready(function() {



	/*认证协商01*/
	$("#Identity01").click(function() {

		//var h=$("#PostionTopFlag").offset().top;
		var w=$("#PostionLeftFlag").offset().left;
		//var h1=$(window).height();
		var w1=$(window).width();	//浏览器当前窗口可视区域宽度
		//var h2=$(document.body).height(); 	//浏览器当前窗口文档body的宽度
		//var w2=$(document.body).width();	//浏览器当前窗口文档body的高度

		//console.log("h="+h);	//0
		console.log("w="+w);	//180

		//console.log("h1="+h1);	//367	//浏览器当前窗口可视区域高度
		console.log("w1="+w1);	//1840	//浏览器当前窗口可视区域宽度
		//console.log("h2="+h2);	//0 浏览器当前窗口文档body的高度
		//console.log("w2="+w2);	//1840 浏览器当前窗口文档body的宽度

		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		console.log("width:"+width);

		$('#IdentityDetail01').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit01").click(function() {
		$("#IdentityDetail01 input").removeAttr("disabled");
		$("#IdentityDetail01 input").css("color", "rgb(32,166,217)");
	});

	$("#save01").click(function() {

		$("#IdentityDetail01 input").attr("disabled", "disabled");
		$("#IdentityDetail01 input").css("color", "rgb(120,120,120)");
		/*	$("#IdentityDetail01").dialog('close');*/
	});

	/*认证协商02*/
	$("#Identity02").click(function() {

		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;

		$('#IdentityDetail02').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit02").click(function() {
		$("#IdentityDetail02 input").removeAttr("disabled");
		$("#IdentityDetail02 input").css("color", "rgb(32,166,217)");

	});

	$("#save02").click(function() {

		$("#IdentityDetail02 input").attr("disabled", "disabled");
		$("#IdentityDetail02 input").css("color", "rgb(120,120,120)");

	});

	/*加密协商*/
	$("#encryptionBtn").click(function() {

		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;

		$('#encryptionDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit03").click(function() {
		$("#encryptionDetail input").removeAttr("disabled");
		$("#encryptionDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save03").click(function() {

		$("#encryptionDetail input").attr("disabled", "disabled");
		$("#encryptionDetail input").css("color", "rgb(120,120,120)");

	});

	/*异常检测*/
	$("#exceptionBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#exceptionDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit04").click(function() {
		$("#exceptionDetail input").removeAttr("disabled");
		$("#exceptionDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save04").click(function() {
		$("#exceptionDetail input").attr("disabled", "disabled");
		$("#exceptionDetail input").css("color", "rgb(120,120,120)");

	});

	/*防病毒设计*/
	$("#defendBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#defendDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit05").click(function() {
		$("#defendDetail input").removeAttr("disabled");
		$("#defendDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save05").click(function() {
		$("#defendDetail input").attr("disabled", "disabled");
		$("#defendDetail input").css("color", "rgb(120,120,120)");

	});

	/*通信重传*/
	$("#resendBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#resendDetail').window('open').window('resize', {
			top: w*1.1,
			left:w1>1280?420:300,
			width:w1>1280?w1*0.52:w1*0.68,
			//height:height
		});

	});

	$("#edit06").click(function() {
		$("#resendDetail input").removeAttr("disabled");
		$("#resendDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save06").click(function() {
		$("#resendDetail input").attr("disabled", "disabled");
		$("#resendDetail input").css("color", "rgb(120,120,120)");

	});

	/*完整性校验*/
	$("#integrityBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#integrityDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit07").click(function() {
		$("#integrityDetail input").removeAttr("disabled");
		$("#integrityDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save07").click(function() {
		$("#integrityDetail input").attr("disabled", "disabled");
		$("#integrityDetail input").css("color", "rgb(120,120,120)");

	});
	
	/*自定义*/
	$("#customBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#customFieldDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});

	});

	$("#edit10").click(function() {
		$("#customFieldDetail input").removeAttr("disabled");
		$("#customFieldDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save10").click(function() {
		$("#customFieldDetail input").attr("disabled", "disabled");
		$("#customFieldDetail input").css("color", "rgb(120,120,120)");
	});

	/*加密通信*/
	$("#encryCommunicateBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#encryCommunicateDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width,
			//height:height
		});
	});

	$("#edit08").click(function() {
		$("#encryCommunicateDetail input").removeAttr("disabled");
		$("#encryCommunicateDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save08").click(function() {
		$("#encryCommunicateDetail input").attr("disabled", "disabled");
		$("#encryCommunicateDetail input").css("color", "rgb(120,120,120)");

	});

	/*0Rtt*/
	$("#0RTTIdentityBtn").click(function() {
		var w=$("#PostionLeftFlag").offset().left;
		var w1=$(window).width();
		var width=0.5*w1>800?0.5*w1:800;
		var height=w1*0.4>445?445:w1*0.4;
		$('#0RTTIdentityDetail').window('open').window('resize', {
			top: w*1.1,
			left:w*2,
			width:width
			//height:height
		});
	});

	$("#edit09").click(function() {
		$("#0RTTIdentityDetail input").removeAttr("disabled");
		$("#0RTTIdentityDetail input").css("color", "rgb(32,166,217)");

	});

	$("#save09").click(function() {
		$("#0RTTIdentityDetail input").attr("disabled", "disabled");
		$("#0RTTIdentityDetail input").css("color", "rgb(120,120,120)");

	});

});

function checkNumReg() {
    var value = $(this).val();
    var reg = /^[0-9]*$/;
    if(reg.test(value)!=true){
        alert("字段位置输入不规范");
        $(this).val(0);
    }
}